﻿<UserControl x:Class="Reactor.Client.Views.UpgradeServiceForm"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:Controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data.DataForm.Toolkit" mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="400">

    <Controls:DataForm 
            CurrentItem="{Binding}"
            IsEnabled="{Binding IsBusy, Converter={StaticResource NotOperatorValueConverter}}"
            AutoEdit="True" 
            Header="Choose the version to upgrade to" 
            Style="{StaticResource DataFormStyle}">
        <Controls:DataForm.EditTemplate>
            <DataTemplate>
                <StackPanel Orientation="Vertical">
                    <Controls:DataField>
                        <TextBlock Text="{Binding CoreName, Mode=OneTime}" />
                    </Controls:DataField>
                    <Controls:DataField>
                        <TextBlock Text="{Binding ServiceName, Mode=OneTime}" />
                    </Controls:DataField>
                    <Controls:DataField>
                        <TextBlock Text="{Binding FromVersion, Mode=OneTime}" />
                    </Controls:DataField>
                    <Controls:DataField>
                        <ComboBox 
                            ItemsSource="{Binding PossibleUpgradeVersions}"
                            SelectedItem="{Binding ToVersion, Mode=TwoWay}" >
                        </ComboBox>
                    </Controls:DataField>
                </StackPanel>
            </DataTemplate>
        </Controls:DataForm.EditTemplate>
    </Controls:DataForm>
</UserControl>
